﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Extensions.DependencyInjection;

using Xc.DataAccess.OneNetCore.Models;
using Xc.Logics.AepCoap.Services;
using Xc.Logics.OneNet.Views;
using Xc.Views.Core;

namespace Xc.Logics.OneNet
{
    [Boot("OneNet设备导入软件")]
    public class StartUp : ApplicationBooster<AppSetting>
    {
        protected override void BeforeBuild(IServiceCollection serviceDescriptors)
        {
            serviceDescriptors.AddOneNetService();
            serviceDescriptors.AddSettingService<AppSetting>();
            serviceDescriptors.AddTransient<MasterView>();
            serviceDescriptors.AddTransient<LogView>();
            serviceDescriptors.AddEncodingServcie();
            serviceDescriptors.AddTransient<IOneNetUploadService, OneNetUploadService>();
            serviceDescriptors.AddCsvService();
            base.BeforeBuild(serviceDescriptors);
        }
        /// <summary>
        /// 获取主UI元素
        /// </summary>
        /// <returns></returns>
        public MasterView GetMainElement()
        {
           return this.GetMainElement<MasterView>();
        }
    }
    public class AppSetting
    {
        public OneNetSetting OneNetSetting { get; set; } = new OneNetSetting();
    }
}
